/*
    This file is part of Titan.

    Titan is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as 
    published by the Free Software Foundation, either version 3 of 
    the License, or (at your option) any later version.

    Titan is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Titan. If not, see <http://www.gnu.org/licenses/>.
*/

package titancommon.execution;

import java.util.Observable;
import java.util.Observer;
import titan.TitanCommunicate;
import titancommon.services.ServiceDirectory;

/**
 * 
 * @author Clemens Lombriser <lombriser@ife.ee.ethz.ch>
 * 
 * A MultiTaskNetworkManager handles the network configuration over 
 * time. Depending on the data generated by some networks, it replaces the 
 * task graphs currently executing. 
 * 
 */

public interface MultiTaskNetworkManager extends Observer {
    
    /**
     * The initialization data sets the parameters that will alway be used by 
     * any manager.
     * @param sd the service directory of the network
     * @param tc the communication entity connecting to the network
     * @return whether the manager could successfully be started
     */
    public boolean initiate( ServiceDirectory sd, TitanCommunicate tc );
    
    /**
     * Starts the execution of the task graph set.
     * @return
     */
    public boolean start();
    
    /**
     * Gets the human readable identifier of the manager. This name could be 
     * displayed to the user to select the execution
     * @return Human readable identifier.
     */
    public String getName();

    /**
     * This interface is used to notify the manager of any event relating to 
     * it. This might be messages received from the network, or notifications 
     * from the service directory.
     */
    public void update(Observable obs, Object param);
}
